import request from "@/utils/request";
import { setToken } from "@/utils/storage";
import { GET_ARTICLE_LIST, GET_CHANNEL_LIST } from "../constanst/article";
import { LOGIN } from "../constanst/login";
import { GET_USER_INFO } from "../constanst/user";
export const getChannelList = () => {
  return async (dispatch) => {
    const res = await request.get('/channels')
    dispatch({
      type:GET_CHANNEL_LIST,
      payload:res.data.data.channels
    })
  }
}
export const getArticleList = () => {
  return async (dispatch) => {
    const res = await request.get('/mp/articles')
    dispatch({
      type:GET_ARTICLE_LIST,
      payload:res.data.data
    })
  }
}